-- test the list indexing functions
indextest is package{
  LL is list{"a";"b";"c";"d";"e";"f"};
  
  Ag is agg{
    LL = list{"a";"b";"c";"d";"e";"f"};
  };
  
  type Agg is agg{
    LL has type list of string;
  };
  
  CC is cons of {"a";"b";"c";"d"};
  
  MM is hash{"a"->1;"b"->2;"c"->3};
  
  main has type action();
  main() do {
    logMsg(info,"$LL");
    XX is LL[size(LL)-1];
    assert XX="f";
    logMsg(info,"LL[\$]=$XX");
    
    EE is LL[size(LL)-2];
    logMsg(info,"EE = $EE");
    
    AA is LL[0];
    logMsg(info,"AA = $AA");
    assert AA="a";
        
    BB is Ag.LL[1];
    logMsg(info,"BB=$BB");
    
    DD is Ag.LL[size(LL)-3];
    logMsg(info,"DD=$DD");
    
    assert (LL[10] default "none") = "none";
    
    assert MM["a"]=1;
    assert MM["b"]=2;
    assert MM["c"]=3;
    assert (MM["e"] default nonInteger)=nonInteger;
    
    assert CC[0]="a";
    assert CC[1]="b";
  }
}